home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / faq / comp / x_faq / part5 < prev    next >
Text File  |  1994-03-04  |  44KB  |  886 lines

  1. Newsgroups: comp.windows.x,news.answers,comp.answers
  2. Path: bloom-beacon.mit.edu!hookup!swrinde!cs.utexas.edu!uunet!visual!dbl
  3. From: dbl@visual.com (David B. Lewis)
  4. Subject: comp.windows.x Frequently Asked Questions (FAQ) 5/6
  5. Message-ID: <CM59JI.A75@visual.com>
  6. Followup-To: poster
  7. Summary: useful information about the X Window System
  8. Reply-To: faq%craft@uunet.uu.net (X FAQ maintenance address)
  9. Organization: VISUAL, Inc.
  10. Date: Fri, 4 Mar 1994 14:28:30 GMT
  11. Approved: news-answers-request@MIT.Edu
  12. Expires: Sun, 3 Apr 1994 00:00:00 GMT
  13. Lines: 870
  14. Xref: bloom-beacon.mit.edu comp.windows.x:22117 news.answers:16018 comp.answers:4035
  15.  
  16. Archive-name: x-faq/part5
  17. Last-modified: 1994/03/03
  18.  
  19. ----------------------------------------------------------------------
  20. Subject:  94)  Where can I find X tools callable from shell scripts?
  21. I want to have a shell script pop up menus and yes/no dialog boxes if the user 
  22. is running X.
  23.  
  24.     Several tools in the R3 contrib/ area were developed to satisfy these
  25. needs: yorn pops up a yes/no box, xmessage displays a string, etc. There are
  26. several versions of these tools; few, if any, have made it to the R4 contrib/ 
  27. area, though they may still be available on various archive sites.
  28.     XScript, a collection of X shell scripts, is on csc.canberra.edu.au 
  29. under /pub/motif/xscript and also on ftp.x.org; it includes several stand-alone
  30. X applications which can be embedded in shell scripts. XScript requires 
  31. tclMotif 1.0 or later.
  32.     In addition, Richard Hesketh (rlh2@ukc.ac.uk) has posted the xmenu
  33. package to comp.sources.x ("v08i008: xmenu") for 1-of-n choices.  [7/90]
  34.     Two versions of XPrompt have been posted to comp.sources.x, the latter
  35. being an unauthorized rewrite. [R. Forsman (thoth@reef.cis.ufl.edu), 1/91]
  36.     There is a version of XMenu available from comp.sources.x; it is
  37. being worked on and will likely be re-released.
  38.     xp-1.1.tar.Z, xpick-1.0.tar.Z and xzap-1.0.tar.Z on ftp.x.org's 
  39. contrib/ are tools by Gerry.Tomlinson@newcastle.ac.UK which act as X versions
  40. of the simple display and choice-making tools in K&P. [4/92]
  41.     xtpanel lets the user build a panel containing interactive objects such
  42. as buttons, sliders, text fields, etc., either from the command line or using a
  43. simple scripting language. It is available for anonymous ftp from 
  44. hanauma.Stanford.EDU (36.51.0.16) as pub/X/xtpanel-3.01.tar.Z and may also be 
  45. found in the alt.sources archives.
  46.  
  47. ----------------------------------------------------------------------
  48. Subject:  95)  Where can I get an X-based debugger?
  49.  
  50.     xdbx, an X interface to the dbx debugger, is available via ftp from 
  51. ftp.x.org. The current [1/91] version is 2.1 patchlevel 2.
  52.     An X interface to gdb called xxgdb is more like xdbx 2.1.2. It is part 
  53. of comp.sources.x volume 11 [2/91]; xxgdb-1.06.tar.Z is on ftp.x.org.
  54.     mxgdb is a Motif interface to gdb by Jim Tsillas 
  55. (jtsillas@proteon.com); version 1.2 was released 11/93.
  56.     UPS is a source-level debugger which runs under the X11 (and SunView)
  57. window systems on Sun, DEC, and Linux platforms. It is available from ftp.x.org 
  58. (18.24.0.11) as contrib/ups-2.45.tar.Z (also ups-2.45-to-2.45.2.patch.Z)
  59. and unix.hensa.ac.uk (129.12.21.7) in /pub/misc/unix/ups (or try mail to 
  60. archive@unix.hensa.ac.uk). [10/92] Unofficial fixes by Rod Armstrong 
  61. (rod@sj.ate.slb.com) are on unix.hensa.ac.uk in 
  62. /misc/unix/ups/contrib/rod@sj.ate.slb.com.
  63.  
  64. Also:
  65.     MIPS produces a highly-customizable (WCL-based) Visual Debugger.
  66.     You should be able to use Sun's dbxtool with its X11/NeWS server.
  67.     The CodeCenter (617-498-3000) source-level debugger, available on most
  68. major platforms, includes an X-based interface.
  69.     AT&T offers the eXamine Graphical Interface, an X11 interface to dbx
  70. and C++ dbx for Sun3 and Sun4 and sdb and sdb++ for 386 and 3B2 platforms. Call
  71. 1-508-960-1997 or contact examine@mvuxi.att.com for more information.
  72.         Solbourne (+1 303-678-4626) offers PDB, its X-based debugger for C, C++
  73. and Fortran.  PDB uses the OI toolkit and runs in either Open Look or Motif 
  74. mode. 
  75.     SCO (info@sco.com) offers dbXtra as part of several development 
  76. systems.
  77.         Lucid's Energize Programming System, a tightly integrated development
  78. environment for C and C++ programs, incorporates a graphical user interface on
  79. top of an extended version of gdb. Info:  lucid-info@lucid.com, or
  80. (800) 223-9322.
  81.  
  82. ----------------------------------------------------------------------
  83. Subject:  96)  How can I "tee" an X program identically to several displays? 
  84.  
  85.     There are several protocol multiplexer tools which provide for the 
  86. simultaneous display of X clients on any number of machines.
  87.     XMX (an X Protocol Multiplexor) is available from wilma.cs.brown.edu 
  88. (128.148.33.66) as pub/xmx.tar.Z It works independently of the server and does
  89. not affect the application being shared; it was developed for use in the
  90. electronic classroom. An update is expected soon [5/93].
  91.     XTV is a conference program which can be used to duplicate the
  92. "chalkboard" on several displays. Release 1 is available on the X11R5 contrib
  93. tapes; a more recent version is on ftp.cs.odu.edu as pub/wahab/XTV.r2.tar.Z.
  94.     SHX from Michael Altenhofen of Digital Equipment GmbH CEC Karlsruhe 
  95. also does this; it is a "WYSIWIS" (What You See Is What I See) package in the 
  96. context of a computer-based learning/training tool to provide online help from
  97. remote tutors but is also useful for general window sharing. Information: 
  98. shX@nestvx.enet.dec.com.  SHX can be found on ftp.x.org and 
  99.         gatekeeper.dec.com:/pub/X11/contrib/shX.tar.Z, 
  100.         crl.dec.com:/pub/X11/contrib/shX.tar.Z 
  101. Modifications to SHX for color mapping and private color allocation by
  102. Mark J. Handley (M.Handley@cs.ucl.ac.uk) are on cs.ucl.ac.uk in 
  103. car/shX.car.tar.Z.
  104.     XTrap is implemented as a server/library extension and can be used
  105. to record and then replay an x session. It is available as
  106. ftp.x.org:/contrib/XTrapV33_X11R5.tar.Z.    
  107.     wscrawl can be used as a "multi-person paint program". It's available
  108. on sax.stanford.edu as wscrawl.shar.Z. Binaries are on doppler.ncsc.org in 
  109. pub/wscrawl.
  110.     Shdr implements a simple shared whiteboard, without a chalk-passing
  111. mechanism. It's available on parcftp.xerox.com as pub/europarc/shdr.tar.Z.
  112.     SketchPad 1.0 (3/93) is a distributed interactive graphical editor 
  113. particularly designed for sketching. Sources have been posted to alt.sources
  114. and are available from ftp.igd.fhg.de (192.44.32.1) in ~ftp/incoming/sketchpad.
  115.     The NESTOR project is described in "Upgrading A Window System For 
  116. Tutoring Functions", Michael Altenhofen et al., the proceedings of the EXUG
  117. Conference 11/90.
  118.  
  119. Also of use:
  120.         Hewlett-Packard Co. has a commercial product, "HP SharedX" which works
  121. under HP-UX currently on their 300, 400, and 700 series workstations and their
  122. HP 700/RX X Stations.  Machines receiving shared windows can be any X server.
  123. HP SharedX consists of a server extensions and a Motif based user interface
  124. process.  Contact your local HP sales rep. for more information.
  125.     IBM offers a commercial product.
  126.     Sun offers multi-user confering software called ShowMe.
  127.     InSoft (Mechanicsburg, PA, USA, 717-730-9501) offers multi-user 
  128. conferencing software called Communique. Version 3.0 is available on Sun and
  129. HP platforms.
  130.     Vartalaap is a multiparty multimedia Conferencing System that works
  131. over Unix sockets; the interfaceis based on XView.  It's available at 
  132. ftp.x.org under contrib/vartalaap.tar.Z.
  133.     Collage is a synchronous collaborative data analysis tool for use
  134. over the Internet.  Features include a shared whiteboard, screen
  135. capture/sharing, a shared text editor, and data-analysis tools.  Sources are
  136. on ftp.ncsa.uiuc.edu (141.142.20.50) in /UNIX/XCollage/Collage1.2.  Version
  137. 1.2 became available 10/93.
  138.  
  139. [Thanks in part to scott@spectra.com (Tim Scott), 5/91, and to Peter Cigehn 
  140. (peter@lulea.trab.se), 8/92 ]
  141.  
  142. ----------------------------------------------------------------------
  143. Subject:  97)  Can I use C++ with X11? Motif? XView?
  144.     
  145.     The X11R4/5 header files are compatible with C++. The Motif 1.1 header 
  146. files are usable as is inside extern "C" {...}. However, the definition of
  147. String in Intrinsic.h can conflict with the libg++ or other String class and
  148. needs to be worked around.
  149.  
  150.     Some other projects which can help:
  151.  
  152.     WWL, a set of C++ classes by Jean-Daniel Fekete to wrap X Toolkit 
  153. widgets, available via anonymous FTP from ftp.x.org as contrib/WWL-1.2.tar.Z 
  154. [7/92] or lri.lri.fr (129.175.15.1) as pub/WWL-1.2.tar.Z.  It works by 
  155. building a set of C++ classes in parallel to the class tree of the widgets.
  156.     The C++ InterViews toolkit is obtainable via anonymous FTP from 
  157. interviews.stanford.edu. InterViews uses a box/glue model similar to that of 
  158. TeX for constructing user interfaces and supports multiple looks on the user 
  159. interfaces. Some of its sample applications include a WYSIWIG document editor 
  160. (doc), a MacDraw-like drawing program (idraw) and an interface builder 
  161. (ibuild).
  162.     THINGS,  a class library written at the Rome Air Force Base by the 
  163. Strategic Air Command, available as freeware on archive sites.
  164.  
  165.     Motif++ is a public-domain library that defines C++ class wrappers
  166. for Motif 1.1 and 1.2; it adds an "application" class for, e.g., initializing
  167. X, and also integrates WCL and the Xbae widget set. This work was developed
  168. by Ronald van Loon <rvloon@motif.hacktic.nl> based on X++, a set of bindings
  169. done by the University of Lowell Graphics Research Laboratory. The current
  170. sources are available from decuac.dec.com (192.5.214.1) in
  171. /pub/X11/motif++.28.jul.93.tar.gz; in the UK check src.doc.ic.ac.uk. Send to 
  172. motif++-request@motif.hacktic.nl to be added to the mailing list.
  173.  
  174.     Xm++ is a user interface framework for C++ using the Motif and Athena
  175. toolkits.  Source is on ftp.x.org as contrib/Xm++.0.52.tar.Z; or email to 
  176. xmplus@ani.univie.ac.at.
  177.     
  178.     The source code examples for Doug Young's "Object-Oriented Programming 
  179. with C++ and OSF/Motif" [ISBN 0-13-630252-1] do not include "widget wrappers" 
  180. but do include a set of classes that encapsulates higher-level facilities 
  181. commonly needed by Motif- or other Xt-based applications; check ftp.x.org in
  182. ~ftp/contrib/young.c++.tar.Z.
  183.     Rogue Wave offers "View.h++" for C++ programmers using Motif; info:
  184. 1-800-487-3217 or +1 503 754 2311.
  185.     A product called "Commonview" by Glockenspiel Ltd, Ireland (??) 
  186. apparently is a C++-based toolkit for multiple window systems, including PM,
  187. Windows, and X/Motif.
  188.     Xv++ is sold by Qualix (415-572-0200; fax -1300); it implements an 
  189. interface from the GIL files that Sun's OpenWindows Developers Guide 3.0 
  190. produces to Xview wrapper classes in C++.
  191.  
  192.     UIT is a set of C++ classes embedding the XView toolkit; it is intended
  193. for use with Sun's OpenWindows Developers Guide 3.0 builder tool. Sources are 
  194. on ftp.x.org as UIT.tar.Z. Version 2 was released 5/28/92.
  195.     
  196.     Also of likely use is ObjectCenter (Saber-C++). And a reasonable
  197. alternative to all of the above is ParcPlace's (formerly Solbourne's) Object 
  198. Interface.
  199.  
  200. [Thanks to Douglas S. Rand (dsrand@mitre.org) and George Wu (gwu@tcs.com);2/91]
  201.  
  202. ----------------------------------------------------------------------
  203. Subject:  98)  Where can I obtain alternate language bindings to X/Xt/Motif?
  204.  
  205.     Versions of the CLX Lisp bindings are part of the X11 core source 
  206. distributions. A version of CLX is on the R5 tape [10/91]; version 5.0.2 [9/92]
  207. is on ftp.x.org in /contrib/CLX.R5.02.tar.Z.
  208.  
  209.     The SAIC Ada-X11 bindings are through anonymous ftp in /pub from
  210. stars.rosslyn.unisys.com (128.126.164.2) [perhaps
  211. falcon.stars.ballston.paramax.com (129.204.6.253)?]
  212.     There is an X/Ada study team sponsored by NASA JSC, which apparently is
  213. working out bindings. Information: xada@ghg.hou.tx.us.
  214.     GNU SmallTalk has a beta native SmallTalk binding to X called STIX (by
  215. Steven.Byrne@Eng.Sun.COM). It is still in its beginning stages, and 
  216. documentation is sparse outside the SmallTalk code itself. The sources are 
  217. available as /pub/gnu/smalltalk-1.1.1.tar.Z on prep.ai.mit.edu (18.71.0.38) or 
  218. ugle.unit.no (129.241.1.97).
  219.     Prolog bindings (called "XWIP") written by Ted Kim at UCLA while
  220. supported in part by DARPA are available by anonymous FTP from
  221. ftp.x.org:contrib/xwip.tar.Z or ftp.cs.ucla.edu:pub/xwip.tar.Z.
  222. These prolog language bindings depend on having a Quintus-type foreign function
  223. interface in your prolog. The developer has gotten it to work with Quintus and 
  224. SICStus prolog. Inquiries should go to xwip@cs.ucla.edu. [3/90]
  225.     Scheme bindings to Xlib, OSF/Motif, and Xaw are part of the Elk
  226. distribution; version 1.5a on ftp.x.org obsoletes the version on the R5 contrib
  227. tape. 
  228.     TCL bindings to Motif 1.[12] by Jan Newmarch 
  229. (jan@pandonia.canberra.edu.au) are on csc.canberra.edu.au and ftp.x.org. 
  230. Version 0.8 became available 11/93.
  231.     x-scm, a bolt-on accessory for Aubrey Jaffer's "scm" Scheme interpreter
  232. that provides an interface to Xlib, Motif, and OpenLook, is now available via 
  233. FTP from altdorf.ai.mit.edu:archive/scm/xscm1.05.tar.Z and 
  234. nexus.yorku.ca:pub/scheme/new/xscm1.05.tar.Z.
  235.  
  236.     Poplog V14.2 is offered by Integral Solutions Ltd. (Phone +44 (0)256
  237. 882028; Fax +44 (0)256 882182; Email isl@integ.uucp); it is an integrated
  238. programming environment consisting of the programming languages Pop-11,
  239. Prolog, Standard ML, and Lisp which are compiled to machine code via a common
  240. virtual machine. Pop-11 provides an interface to the X Toolkit which can be
  241. accessed from all other Poplog languages. The OLIT, Motif, and Athena widget
  242. sets are supported, in addition to the custom Poplog (Xpw) widget set.
  243. High-level Pop-11 libraries allow graph drawing, turtle graphics, and the
  244. simple creation of basic button/menu based interfaces.
  245.  
  246.     Ada bindings to Motif, explicitly, will eventually be made available by
  247. the Jet Propulsion Laboratories, probably through the normal electronic
  248. means.  Advance information can be obtained from dsouleles@dsfvax.jpl.nasa.gov,
  249. who may respond as time permits.
  250.     AdaMotif is a complete binding to X and Motif for the Ada language, for
  251. many common systems; it is based in part upon the SAIC/Unisys bindings and also
  252. includes a UIL to Ada translator. Info: Systems Engineering Research 
  253. Corporation, 1-800-Ada-SERC (well!serc@apple.com).
  254.  
  255.     Also: the MIT Consortium, although not involved in producing Ada
  256. bindings for X, maintains a partial listing of people involved in X and Ada;
  257. information is available from Donna Converse, converse@x.org.
  258.  
  259. ----------------------------------------------------------------------
  260. Subject:  99)  TOPIC: BUILDING THE X DISTRIBUTION [topic needs updating to R5]
  261. ----------------------------------------------------------------------
  262. Subject: 100)  What's a good source of information on configuring the X build?
  263.  
  264.     This FAQ includes information on a number of "gotchas" that can bite 
  265. you on particular system. However, the best source of general information on 
  266. building the X11 release is found in the Release Notes. The file is bundled 
  267. separately from the rest of the release, so if it's become separated from your 
  268. sources you can FTP another copy separately: the file RELNOTES.[ms,PS,TXT] at 
  269. the top of the distribution. The file RELNOTES is also available from the 
  270. xstuff mail server.
  271.     In addition, O'Reilly & Associates's Volume 8 on X Administration
  272. includes information on configuring and building X.
  273.  
  274. ----------------------------------------------------------------------
  275. Subject: 101)  Why doesn't my Sun with a cg6 work with R5?
  276.  
  277.     Apparently gcc is the problem; it seems to produce fine code for all
  278. Sun displays except for the cgsix. The new sunGX.o distributed with fix-07 
  279. may fix the problem (note: not known to work on Solaris).
  280.  
  281. ----------------------------------------------------------------------
  282. Subject: 102)  Why doesn't my Sun with SunOS 4.1 know about _dlsym, etc.?
  283.  
  284.     If you get errors with _dlsym _dlopen _dlclose undefined, link with 
  285. libdl.a.  Add "-ldl" to your and eventually to your site.def.  You may want to 
  286. surround it with "-Bstatic -ldl -Bdynamic" if you add it to the EXTRA_LIBRARIES
  287. variable, since "syslibs" get added after EXTRA_LIBRARIES on the eventual 
  288. compilation command; otherwise you may not have a shared libdl.  (Or compile 
  289. the stubs shared.)
  290.  
  291. [thanks to Joe Backo (joe.backo@East.Sun.COM), 12/91]
  292.  
  293. ----------------------------------------------------------------------
  294. Subject: 103)  What is this "_get_wmShellWidgetClass undefined" error?
  295.  
  296.     In SunOS 4.1.2 Sun fixed a shared-library bug in ld which conflicts
  297. with the way X builds the shared Xmu library, causing these symbols, notably, 
  298. to be undefined when building some X11 clients on SunOS 4.1.[23]: 
  299.     _get_wmShellWidgetClass
  300.     _get_applicationShellWidgetClass
  301. Compiling "-Bstatic -lXmu -Bdynamic" is overkill; be sure to set
  302. OSTeenyVersion correctly in the config/sun.cf file and rebuild X11R5.
  303.  
  304. To solve the problem if you are using OpenWindows 3.0 (X11R4-based Xt), please 
  305. contact your local Sun office and request the following patches:
  306.  
  307. Patch i.d.      Description
  308. 100512-02       4.1.x OpenWindows 3.0 libXt Jumbo patch
  309. 100573-03       4.1.x OpenWindows 3.0 undefined symbols when using
  310.                         shared libXmu
  311.  
  312. [Greg Earle, earle@Sun.COM; 7/92] 
  313.  
  314. A source patch for use with the X11R4 libraries was developed by Conrad 
  315. Kimball (cek@sdc.boeing.com); it retrofits into R4 some fixes made in R5 to
  316. get around this problem. The patch is on ftp.x.org in [1/93]
  317.     contrib/X11R4_sunos4.1.2_patch_version3.Z
  318.  
  319. ----------------------------------------------------------------------
  320. Subject: 104)  What's this problem with undefined _X symbols on SunOS 4.1.3?
  321.  
  322.         Make sure to set the OSTeenyVersion in the mit/config/sun.cf file
  323. if you see that vast numbers of Xlib functions are undefined:
  324.  
  325.   >cc -o bmtoa bmtoa.o -O -pipe  -L../.././lib/Xmu -lXmu -L/work1/X11R5/lib
  326.   >ld: Undefined symbol
  327.   >   _XGetVisualInfo
  328.   >   _XFree
  329.     ...
  330.  
  331. ----------------------------------------------------------------------
  332. Subject: 105)  Why does cc get used when I build X11R5 with gcc?
  333.  
  334.     When X11R5 was written gcc (version 1.X) did not support shared 
  335. libraries. Those parts requiring shared libraries are compiled with cc, those 
  336. that don't are compiled with gcc.
  337.   
  338. ----------------------------------------------------------------------
  339. Subject: 106)  Why can't gcc 1.x compile X11R4 on my SPARC?
  340. I used gcc to compile the whole distribution, but I get several segmentation
  341. faults when running X.
  342.  
  343.     Note first that gcc on RISC machines does not necessarily result in
  344. any performance increase; it certainly is not as noticeable as it is on the
  345. 680x0 or VAX platforms.
  346.  
  347.     Here is the problem: gcc and cc use incompatible methods of passing 
  348. structures as arguments and returning them as function values, so when 
  349. gcc-compiled parts of X are linked with Sun-supplied functions that pass or 
  350. return structs, run-time errors occur.  Affected programs include rgb and 
  351. the server.
  352.  
  353.     This is from the GCC manual:
  354.  
  355.     On the Sparc, GNU CC uses an incompatible calling convention for 
  356.     structures.  It passes them by including their contents in the argument
  357.     list, whereas the standard compiler passes them effectively by 
  358.     reference.
  359.  
  360.     This really ought to be fixed, but such calling conventions are not yet
  361.     supported in GNU CC, so it isn't straightforward to fix it.
  362.  
  363.     The convention for structure returning is also incompatible, and
  364.     `-fpcc-struct-return' does not help.
  365.  
  366. You can duck the problem either by using cc throughout or by using it for just
  367. the routines which cause incompatibilities; the problem cannot be solved with 
  368. compilation flags.  
  369.  
  370.     Files which need to be compiled using cc include:
  371.         server/os/4.2bsd/oscolor.c 
  372.         rgb/rgb.c
  373.  
  374.     In addition, several of the "inet_" functions use structs as args or
  375. return values:  
  376.         clients/xhost/xhost.c 
  377.         clients/xauth/gethost.c. 
  378. Calls to inet_addr in /lib/CLX/socket.c and lib/X/XConnDis.c are possibly 
  379. harmless as they don't involve structs.
  380.  
  381. [collected by bashford@scripps.edu (Don Bashford); 8/90]
  382.  
  383. ----------------------------------------------------------------------
  384. Subject: 107)  What are these I/O errors running X built with gcc?
  385. When I try to run xinit or the Xsun server I get the error 
  386.     "Getting interface configuration: Operation not supported on socket. 
  387.     Fatal server bug! no screens found."
  388.  
  389.     Running the gcc fixincludes script apparently didn't work. You can do 
  390. this simple test:
  391.  
  392.     #include <sys/ioctl.h>
  393.     SIOCGIFCONF
  394.  
  395. Run that through cc -E and gcc -E.  The last line of output is the piece of 
  396. interest; it should be identical (modulo irrelevant differences like 
  397. whitespace).  If the gcc version has 'x' where the cc version has 'i', your 
  398. fixincludes run didn't work for some reason or other; go back to your gcc
  399. sources and run `fixincludes`; then rebuild the X distribution. If they are 
  400. identical, try running a make clean in mit/server and rebuilding, just to make 
  401. sure everything gets compiled with the proper include files.  
  402.  
  403. [courtesy der Mouse, mouse@LARRY.MCRCIM.MCGILL.EDU; 9/90]
  404.  
  405. ----------------------------------------------------------------------
  406. Subject: 108)  What are these problems compiling X11R4 on the older Sun3?
  407. In mit/server/ddx/sun/sunCG3C.c, we have found "missing" defines for 
  408. CG3AC_MONOLEN, CG3BC_MONOLEN, CG3AC_ENBLEN, CG3BC_ENBLEN. What should these be?
  409.  
  410.     The R4 Errata list distributed after X11R4 mentions that you can add
  411. these lines to the file on older SunOS versions (e.g. 3.5) to compile:
  412.         #define CG3AC_MONOLEN (128*1024)
  413.         #define CG3AC_ENBLEN  CG3AC_MONOLEN
  414.         #define CG3BC_MONOLEN CG3AC_MONOLEN
  415.         #define CG3BC_ENBLEN  CG3AC_MONOLEN
  416.  
  417.     However, the Sun3 should not actually ever have the CG3 device, and so 
  418. references to it can be removed from mit/server/ddx/sun/sunInit.c and the 
  419. Imakefile.  [11/90]
  420.  
  421. ----------------------------------------------------------------------
  422. Subject: 109)  What are these problems compiling the X server on SunOS 4.1.1?
  423. The file <sundev/cg6reg.h> isn't being found.
  424.  
  425.     Sun omitted <sundev/cg6reg.h> from SunOS 4.1.1. Remove the #include 
  426. from sunCG6C.c and replace it with the line 
  427.     #define CG6_VADDR_COLOR   0x70016000
  428. The file has changed from earlier versions of SunOS and should not be copied 
  429. from another distribution.
  430.  
  431. ----------------------------------------------------------------------
  432. Subject: 110)  What are these problems using R4 shared libraries on SunOS 4?
  433. All of the executables that I try to run have the following results:
  434.     ld.so: libXmu.so.4: not found
  435. or even:
  436.     ld.so: call to undefined procedure __GetHostname from 0xf776a96c
  437.  
  438.     If you are building with shared libraries on a Sun, remember that you 
  439. need to run "ldconfig" as root after installing the shared libraries (if you've
  440. installed X on a file-server, run it on the server's clients, too).  While 
  441. building and installing the distribution, you need to be careful to avoid 
  442. linking against any existing X shared libraries you might have (e.g. those 
  443. distributed with OpenWindows).  You should make sure you do not have 
  444. LD_LIBRARY_PATH set in your environment during the build or the installation.  
  445. If you are going to keep xterm and xload as setuid programs, please note that 
  446. the shared libraries must be installed in /usr/lib, /usr/local/lib, or 
  447. /usr/5lib for these programs to work (or else those programs must be linked 
  448. statically). [courtesy X Consortium]
  449.     Note also that the program mkfontdir is run as part of the build; it
  450. attempts, however, to use the shared libraries before they have been installed.
  451. You can avoid the errors by building mkfontdir statically (pass -Bstatic to
  452. most C compilers).
  453.  
  454. ----------------------------------------------------------------------
  455. Subject: 111)  Can OLIT programs run with R5 Xt? (_XtQString undefined)
  456.  
  457. This is a bug in the OLIT.  _XtQString was an external symbol that existed in 
  458. X11R4 (upon which OW 3.0's libXt is based).  It wasn't documented and was 
  459. removed in X11R5 (MIT's guarantee of upward compatibility between the R4 and R5
  460. libraries only applied to the documented interface).  
  461.  
  462. A workaround is to temporarily set your LD_LIBRARY_PATH to point to the X11R4
  463. or OpenWindows Xt library that you linked the program against.
  464.  
  465. [10/92; from Barry Margolin (barmar@think.com); 3/93 from Jeff Francis 
  466. (jpf@heliocentric.com)]
  467.  
  468. ----------------------------------------------------------------------
  469. Subject: 112)  How do I get around the SunOS 4.1 security hole?
  470.  
  471.     There is a security problem with certain R4 clients (xterm and xload)
  472. running under SunOS 4.1 that have been installed setuid root and are using 
  473. shared libraries; to avoid the problem, do one of these:
  474.     1) make the program non-setuid. You should consult your system
  475. administrator concerning protection of resources (e.g. ptys and /dev/kmem) used
  476. by these programs, to make sure that you do not create additional security 
  477. problems at your site.
  478.     2) relink the programs statically (using -Bstatic).
  479.     3) install the libraries before linking and link with absolute paths
  480. to the libraries.
  481.  
  482. [from rws@x.org (Bob Scheifler), 12/90]
  483.  
  484. The R5 version of xterm does this automatically by rebuilding xterm against the
  485. newly-installed libraries when xterm is being installed; this prevents an suid
  486. program from being built with libraries specified relatively. Note that this 
  487. may cause an inconvenience when doing the installation from NFS-mounted disks. 
  488. Xload has been rewritten to avoid the problem.
  489.  
  490. ----------------------------------------------------------------------
  491. Subject: 113)  How do I get around the frame-buffer security hole?
  492.  
  493.     On many systems the frame-buffer is unsecured by default; this permits 
  494. anyone who can log into your workstation to peek at your windowing session by 
  495. accessing the frame-buffer directly, or, as less of a privacy issue but perhaps
  496. more annoying, to [accidentally] start up a second X session on your console 
  497. display. Check the man page for fbtab(5).
  498.  
  499. [Thanks to Art Mulder (art@cs.ualberta.ca); 2/93.]
  500.  
  501. ----------------------------------------------------------------------
  502. Subject: 114)  TOPIC: BUILDING X PROGRAMS 
  503. ----------------------------------------------------------------------
  504. Subject: 115)  What is Imake?
  505.  
  506.     Imake is not a replacement for the make program; instead, it is a
  507. makefile-generator that takes advantages of the include-file and macro-
  508. processing capabilities of the C preprocessor cpp to generate makefiles 
  509. suitable for building software on a particular system. Although it is not 
  510. specific to X, the X release uses it to help solve a number of the 
  511. configuration issues that arise in making such a large system widely portable.
  512.     Imake has a fairly steep learning curve, in part because the process by
  513. which the system-specific configuration files, system-independent configuration
  514. files, and individual Imakefiles are melded to produce a Makefile is not 
  515. obvious.
  516.     There have been several different versions of imake; the R3, R4, and
  517. R5 versions are different.
  518.  
  519.     You can obtain information on imake from these sources:
  520.     - the R4 and R5 release notes and imake man page include information on
  521. using Imake to build X
  522.     - the R4 and R5 file mit/config/README also contains useful information
  523.     - on the R4 tapes, contrib/doc/imake/imake.tex is Mark Moraes' R3/R4
  524. guide to imake.
  525.     - the R5 mit/doc/config/usenixws/paper.ms contains a paper by Jim
  526. Fulton on an early version of Imake
  527.     - Paul DuBois (dubois@primate.wisc.edu) has written a useful 
  528. explanation of how Imake works and how to use it in configuring X for non-
  529. supported systems; the document is available from ftp.primate.wisc.edu
  530. in the directory ~ftp/pub/imake-stuff; look for config-X11R4.ms (troff) and 
  531. config-X11R4.ps (PostScript). Some supplemental appendices are nearby. 
  532. [7/91: document version is now 1.06] These imake papers are available by email;
  533. mail a message body of "send imake-stuff help" to almanac@primate.wisc.edu.
  534. They are also available by gopher to gopher.primate.wisc.edu under "Primate 
  535. Center Software Archives".
  536.     - see "System Administration - Imake: Friend or Foe?" by Dinah McNutt
  537. in the November 1991 issue of SunExpert.
  538.     - German readers should expect in June 1992 an article "Das Meta-Make 
  539. / I make, you make / Schwerelos" by Rainer Klute in "iX 
  540. Multiuser-Multitasking-Magazin", directed at application programmers needing to
  541. write Imakefiles. An English-language derivative of this article is in The
  542. X Journal, issue 2:1.
  543.     - The O'Reilly X Resource issue #2 contains Paul Davey's article on
  544. demystifying Imake.
  545.     - Alain Brossard's working document full of tips on Imake is in 
  546. sasun1.epfl.ch:pub/imakefile.1.Z.
  547.     - O'Reilly has published (7/93) "Software Portability with imake" by 
  548. Paul DuBois; ISBN 1-56592-055-4. The books electronic counterparts are on
  549. ftp.primate.wisc.edu in pub/imake-book; imake.tar.Z is a stand-alone imake
  550. installation.
  551.  
  552. [1/91;12/91;5/92;8/92;7/93]
  553.  
  554. ----------------------------------------------------------------------
  555. Subject: 116)  Where can I get imake?
  556.  
  557.     Versions are distributed with the R4 and R5 releases. An earlier 
  558. version is distributed with the X11R3 release; some third-party toolkits 
  559. redistribute versions of imake along with their own implementations of the 
  560. template and configuration files. There are no real standards for such 
  561. configuration files, although most *current* contributed software expects the 
  562. templates distributed with X11R5.
  563.     ftp.x.org contains the R5 distribution unpacked, so you can pick up 
  564. imake without picking up the entire distribution.
  565.     A stand-alone version of Imake, but one stemming from X11R5, is in
  566. ftp.germany.eu.net:pub/X11/misc/imake/imake-pure.tar.Z (192.76.144.75).
  567.     A stand-alone version of Imake, but one stemming from X11R5, is in
  568. ftp.primate.wisc.edu:pub/imake-book/imake.tar.Z.
  569.  
  570. ----------------------------------------------------------------------
  571. Subject: 117)  I have a program with an Imakefile but no Makefile. What to do?
  572.  
  573.     If you have R4 or R5 installed on your system, run "xmkmf". This is a 
  574. script which runs imake for you with the correct arguments. The output is a 
  575. Makefile configured for your system and based on the Imakefile. Then run make, 
  576. which will use that new Makefile to compile the program.
  577.  
  578. ----------------------------------------------------------------------
  579. Subject: 118)  Why can't I link to the Xlib shape routines?
  580. When I try to compile certain programs, I get the following link error:
  581.     Undefined:
  582.     _XShapeQueryExtension
  583.     _XShapeCombineMask
  584.  
  585.     These routines are actually part of the Shape Extension to X (SHAPE)
  586. which was introduced in the X11R4 distribution and allows non-rectangular
  587. windows.  Like the other sample server extensions, the shape extension will 
  588. only run on a server which supports it.  Pre-X11R4 servers, as well as many 
  589. vendor-supplied servers, do not support the shape extension, in which case 
  590. they will display rectangular windows anyway.
  591.  
  592.     In order to use the shape extension, you must link to the library 
  593. libXext.a.  In the X11R4 distribution, this library and the associated includes
  594. will be in the mit/extensions directory.  If you do not have these files, do 
  595. not despair:  many freeware programs which use the shape extension can also be 
  596. compiled without it by removing the -DSHAPE define from the Makefile; you can
  597. probably do this and compile successfully against your older vendor-supplied X 
  598. libraries.
  599.  
  600. [from John B. Melby, melby%yk.fujitsu.co.jp@uunet.uu.net, 3/91]
  601.  
  602. ----------------------------------------------------------------------
  603. Subject: 119)  What are these problems with "_XtInherit not found" on the Sun?
  604. When I link a X program that I wrote on a SunOS 4.0.3 or 4.1 machine I get the 
  605. error "ld.so: symbol not found _XtInherit".
  606.  
  607.     What you are seeing is a side-effect of a kludge in the R4 libXt.a to 
  608. get Sun shared libraries working.  Apparently, you can't share a function that 
  609. is both called and compared, as _XtInherit is. This was handled by putting 
  610. _XtInherit in the same file as a function that is always used, thereby 
  611. guaranteeing that it would be loaded -- that is, in Initialize.c, where 
  612. XtToolkitInitialize() and XtInitialize() reside. These routines would normally
  613. be called.
  614.  
  615.     You are probably seeing this error because your program is not a normal
  616. Xt-based program and does not call XtToolkitInitialize() anywhere. 
  617.     1) it may be a program that uses Xt functions but never opens a 
  618. connection to the X server.  [OSF/Motif's 1.1.0 UIL had this problem; it called
  619. XtMalloc() and other Xt functions.] The solution is to add the call to your 
  620. program; the function does not have to be executed, just linked in.
  621.     2) alternatively, your program doesn't need any Xt functions and is
  622. correct in not calling XtToolkitInitialize() -- it may be an Xlib or XView 
  623. program. In this case, you can remove -lXt from your link command. 
  624.  
  625.     It should not be necessary to link the shared libraries statically,
  626. although this will certainly solve the problem.
  627.     
  628. [from Jordan Hayes (now jordan@MooreNet.COM) and Danny Backx (db@sunbim.be); 
  629. 11/90]
  630.  
  631. You may also see this error compiling X11R5 programs on a SunOS 4.1.3 machine;
  632. be sure to set OSTeenyVersion to 3 in the config/sun.cf file.
  633.  
  634. ----------------------------------------------------------------------
  635. Subject: 120)  TOPIC: PROGRAMMING PROBLEMS AND PUZZLES
  636. ----------------------------------------------------------------------
  637. Subject: 121)  Why doesn't my program get the keystrokes I select for (sic)?
  638.  
  639.     The window manager controls how the input focus is transferred from one
  640. window to another.  In order to get keystrokes, your program must ask the
  641. window manager for the input focus.  To do this, you must set up what are
  642. called "hints" for the window manager.  If your applications is Xlib-based, you
  643. can use something like the following:
  644.  
  645.         XWMHints wmhints;
  646.         ...
  647.         wmhints.flags = InputHint;
  648.         wmhints.input = True;
  649.         XSetWMHints(dpy, window, &wmhints)
  650.  
  651. If your application is based on the Xt Intrinsics, you can set the XtNinput 
  652. resource to be True (as you probably want to in any case); if you don't have
  653. source, you can start up the application with the resource '*input:True'.
  654.  
  655. Certain window managers, notably dxwm and olwm, are very picky about having 
  656. this done. 
  657.  
  658.     If you are using Sun's OpenWindows olwm, you can also add this resource
  659. to your defaults file to use clients that aren't ICCCM-compliant.
  660.     OpenWindows.FocusLenience:       true
  661.  
  662. [mostly courtesy Dave Lemke of NCD and Stuart Marks of Sun]
  663.  
  664. ----------------------------------------------------------------------
  665. Subject: 122)  How do I deiconify a window?
  666.  
  667. To de-iconify a window, map it with XMapWindow().  To iconify a window, use 
  668. XIconifyWindow().
  669.  
  670. ----------------------------------------------------------------------
  671. Subject: 123)  How do I figure out what window manager is running?
  672.  
  673.     You can't reliably tell; whatever mechanism you could use could be
  674. spoofed in any case. 
  675.     For most cases, you shouldn't care which window manager is running, so 
  676. long as you do things in an ICCCM-conformant manner. There are some cases in 
  677. which particular window managers are known to do things wrong; checking for
  678. particular hints placed on the window by the window manager so that you can 
  679. sidestep the problem may be appropriate in these cases. Alternatively, it may 
  680. be appropriate to determine which window manager is running in order to take
  681. advantage of specific *added* features (such as olwm's push-pin menus) in order
  682. to give your program *added* functionality. Beware of usurping the window 
  683. manager's functions by providing that functionality even when it is missing;
  684. this surely leads to future compatibility problems.
  685.  
  686. ----------------------------------------------------------------------
  687. Subject: 124)  Is there a skeleton X program available?
  688.     
  689.     There is no general framework such as the TransSkel program for the 
  690. Macintosh which handles lots of the odds and ends and overhead of development 
  691. under a window system and which can be used as a platform for additional 
  692. development. In X, the problem is typically solved by using an interactive 
  693. application builder tool or by using cut&paste on existing X applications. Good
  694. applications which you might look to manipulate when you want to "test just 
  695. this one little thing" include contrib/clients/xskel, a simple R4 program that 
  696. puts up a window and allows sketching in it and offers a starting point for
  697. quick hacks, the Xaw examples in the examples/ directory in the R3 and R4 
  698. distributions, and the Xlib "Hello World" example in the R3 doc/HelloWorld and 
  699. R4 doc/tutorials/HelloWorld; an updated version of this program which uses R4 
  700. Xlib calls and current ICCCM conventions was posted in 2/90 to comp.windows.x  
  701. by Glenn Widener of Tektronix.     [3/90]
  702.  
  703.     In addition, a sample Xt program (for Xaw or Xm) by Rainer Klute 
  704. showing how to open multiple displays and how to catch a broken display 
  705. connection is available on ftp.x.org in contrib/mdisp.tar.Z. [4/92] 
  706.     A sample multi-display Xt/Xaw program by Oliver Jones is on ftp.x.org
  707. in contrib/MultiUserVote.tar.Z. (See also his article in The X Resource, Issue 
  708. 3, "Multi-User Application Software Using Xt".)
  709.  
  710. ----------------------------------------------------------------------
  711. Subject: 125)  Why does XtGetValues not work for me (sic)?
  712.  
  713.     The XtGetValues interface for retrieving resources from a widget is
  714. sensitive to the type of variable. Your code may be doing something like this:
  715.     {
  716.     Arg args[3];
  717.     int i;
  718.     int sensitive;        /* oops; wrong data type */
  719.     i=0;
  720.     XtSetArg (args[i], XtNsensitive, &sensitive); i++;
  721.     XtGetValues(widget, args, i );
  722.     ...
  723.     }
  724.  
  725. But XtNsensitive is a Boolean, which on most machines is a single byte; 
  726. declaring the variable "sensitive" as Boolean works properly. This problem 
  727. comes up often when using particular toolkits that redefine the Xt types 
  728. Dimension and Position; code that assumes they are int will have similar 
  729. problems if those types are actually short. In general: you are safe if you
  730. use the actual type of the resource, as it appears in the widget's man page.
  731. [11/90]
  732.  
  733. ----------------------------------------------------------------------
  734. Subject: 126)  Why don't XtConfigureWidget/XtResizeWidget/XtMoveWidget work?
  735.  
  736.     You're probably trying to use these functions from application code.
  737. They should be used only internally to widgets; these functions are for a
  738. parent Composite widget to change the geometry of its children.  An
  739. application which calls XtMoveWidget, for example, effectively defeats
  740. geometry negotiation and the Composite parent's internal state (if any) will
  741. no longer be correct. (The Xt specification goes into more detail.)
  742.     The only way for your application to request a geometry change for a
  743. widget is to issue an XtSetValues call setting some of the geometry
  744. resources.  Although this call will result in the widget-internal functions'
  745. being called, your application code must use the standard XtSetValues
  746. interface or risk the widgets' data becoming corrupted.
  747.     Note that functions defined in <X11/IntrinsicP.h>, as these are, are
  748. typically reserved for use by widgets.
  749.     Other promising functions, XtMakeGeometryRequest() and
  750. XtMakeResizeRequest(), are also for use only by widgets, in this case by a
  751. child to request a change from its parent.
  752.     The Xlib calls XMoveWindow() and XResizeWindow() should similarly be 
  753. avoided; they shouldn't be used to change XtNx, XtNy, XtNwidth, or XtNheight.
  754.  
  755. ----------------------------------------------------------------------
  756. Subject: 127)  Why isn't there an XtReparentWidget call like XReparentWindow?
  757.  
  758.     Although there are various details of the current implementation of
  759. the Xt internals which make reparenting difficult, the major reason that no
  760. such call exists is that it remains undefined what the set of resources for
  761. the "new" widget should be. Resources are typically set based on the location
  762. in the instance hierarchy; what resources should change if the instance moves?
  763. What should happen to the widget's children? And by the time such semantics are
  764. defined, there would probably be little advantage over destroying the old 
  765. widget and creating a new widget in the correct location with the desired 
  766. resources, as setting the resources correctly is the majority of work in 
  767. creating a new widget. 
  768.  
  769.     Note that reparenting is possible in the OI toolkit.
  770.  
  771. ----------------------------------------------------------------------
  772. Subject: 128)  I'm writing a widget and can't use a float as a resource value.
  773.  
  774. Float resources are not portable; the size of the value may be larger than
  775. the size of an XtPointer. Try using a pointer to a float instead; the Xaw
  776. Scrollbar float resources are handled in this way. 
  777.  
  778. ----------------------------------------------------------------------
  779. Subject: 129)  Is this a memory leak in the X11R4 XtDestroyWidget()?!
  780.  
  781. Yes. This is the "unofficial" fix-19 for the X11R4 Destroy.c:
  782.  
  783. *** Destroy.c.1.37    Thu Jul 11 15:41:25 1991
  784. --- lib/Xt/Destroy.c    Thu Jul 11 15:42:23 1991
  785. ***************
  786. *** 1,4 ****
  787. --- 1,5 ----
  788.   /* $XConsortium: Destroy.c,v 1.37 90/09/28 10:21:32 swick Exp $ */
  789. + /* Plus unofficial patches in revisions 1.40 and 1.41 */
  790.   
  791.   /***********************************************************
  792.   Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  793. ***************
  794. *** 221,239 ****
  795.        */
  796.   
  797.       int i = 0;
  798. !     DestroyRec* dr = app->destroy_list;
  799.       while (i < app->destroy_count) {
  800.       if (dr->dispatch_level >= dispatch_level)  {
  801.           Widget w = dr->widget;
  802.           if (--app->destroy_count)
  803.           bcopy( (char*)(dr+1), (char*)dr,
  804. !                app->destroy_count*sizeof(DestroyRec)
  805.                 );
  806.           XtPhase2Destroy(w);
  807.       }
  808.       else {
  809.           i++;
  810. -         dr++;
  811.       }
  812.       }
  813.   }
  814. --- 222,245 ----
  815.        */
  816.   
  817.       int i = 0;
  818. !     DestroyRec* dr;
  819.       while (i < app->destroy_count) {
  820. +     /* XtPhase2Destroy can result in calls to XtDestroyWidget,
  821. +      * and these could cause app->destroy_list to be reallocated.
  822. +      */
  823. +     dr = app->destroy_list + i;
  824.       if (dr->dispatch_level >= dispatch_level)  {
  825.           Widget w = dr->widget;
  826.           if (--app->destroy_count)
  827.           bcopy( (char*)(dr+1), (char*)dr,
  828. !                (app->destroy_count - i) * sizeof(DestroyRec)
  829.                 );
  830.           XtPhase2Destroy(w);
  831.       }
  832.       else {
  833.           i++;
  834.       }
  835.       }
  836.   }
  837.  
  838. [from Donna Converse, converse@x.org]
  839.  
  840. ----------------------------------------------------------------------
  841. Subject: 130)  Is this a memory leak in the X11R4 deletion of work procs?!
  842.  
  843. Apparently the X11R4 NextEvent.c`CallWorkProc fails to properly replace
  844. the work proc record back on the free list correctly.
  845.  
  846.         if (delete) {
  847.             w->next = freeWorkRecs;
  848.             freeWorkRecs = w->next;    /* should be  =w; */
  849.         }
  850.  
  851. ----------------------------------------------------------------------
  852. Subject: 131)  Why does the process size of my X programs go up,up,up?
  853.  
  854. Using "ps" may not show any decrease in memory size after a malloc/free pair. 
  855. With most vendors' implementations of memory managers, the call to free does 
  856. not return memory to the operating system; it is probably maintained on a free 
  857. list for the process. In addition, ps may not be an accurate report of current
  858. memory usage requirements.
  859.  
  860. ----------------------------------------------------------------------
  861. Subject: 132)  Are callbacks guaranteed to be called in the order registered?
  862.  
  863.     Although some books demonstrate that the current implementation of Xt
  864. happens to call callback procedures in the order in which they are registered, 
  865. the specification does not guarantee such a sequence, and supplemental 
  866. authoritative documents (i.e. the Asente/Swick volume) do say that the order is
  867. undefined.  Because the callback list can be manipulated by both the widget and
  868. the application, Xt cannot guarantee the order of execution.
  869.     In general, the callback procedures should be thought of as operating 
  870. independently of one another and should not depend on side-effects of other
  871. callbacks operating; if a seqence is needed, then the single callback to be 
  872. registered can explicitly call other functions necessary.
  873.  
  874. [4/92; thanks to converse@x.org]
  875.  
  876. ----------------------------------------------------------------------
  877.  
  878. David B. Lewis                     faq%craft@uunet.uu.net
  879.  
  880.         "Just the FAQs, ma'am." -- Joe Friday 
  881. -- 
  882. David B. Lewis        Temporarily at but not speaking for Visual, Inc.
  883. day: dbl@visual.com    evening: david%craft@uunet.uu.net
  884.